﻿<Table TItem="BindItem"
       IsPagination="true" PageItemsSource="@PageItemsSource"
       IsStriped="true" IsBordered="true" IsMultipleSelect="true"
       ShowToolbar="true" ShowExtendButtons="true" ShowSkeleton="true"
       AddModalTitle="增加测试数据窗口" EditModalTitle="编辑测试数据窗口"
       OnQueryAsync="@OnEditQueryAsync" EditMode="EditMode.Inline"
       OnAddAsync="@OnAddAsync" OnSaveAsync="@OnSaveAsync" OnDeleteAsync="@OnDeleteAsync">
    <TableColumns>
        <TableColumn @bind-Field="@context.DateTime" Width="180" />
        <TableColumn @bind-Field="@context.Name">
            <EditTemplate Context="value">
                <div class="form-group col-12 col-sm-6">
                    <TablesNameDrop Model="@((BindItem)value)" />
                </div>
            </EditTemplate>
        </TableColumn>
        <TableColumn @bind-Field="@context.Address" />
        <TableColumn @bind-Field="@context.Education" />
        <TableColumn @bind-Field="@context.Count" />
        <TableColumn @bind-Field="@context.Complete">
            <Template Context="v">
                <Switch IsDisabled="true" Value="v.Value" ShowInnerText="true" OnInnerText="是" OffInnerText="否" />
            </Template>
            <EditTemplate Context="v">
                <div class="form-group col-12 col-sm-6">
                    <Switch @bind-Value="(v as BindItem)!.Complete" ShowInnerText="true" OnInnerText="是" OffInnerText="否" />
                </div>
            </EditTemplate>
        </TableColumn>
    </TableColumns>
</Table>
